<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<div id="sharechild_container" class="share_content_left">
	<c:choose>
		<c:when test="${not empty plist}">
			<%
				int t2 = 1;
			%>
			<c:forEach items="${plist}" var="p">
				<div
					style="height:237px;margin-top:10px;border:1px solid peachpuff;">
					<!-- 左边图片 -->
					<div style="float:left;">
						<img src="${p.orderPic}" style="width:277px;height:233px;"
							onclick="showParticipateDetail('${p.id}','${p.type}');">
					</div>
					<!-- 右边文字 -->
					<div style="text-align:left;">
						<!-- 文字1：作者和作品备注 -->
						<div style="text-align:left;height:30px;">
							[owner:<a href="getFriendOwnMessageAction?uname=${p.name}">${p.name}</a>]${p.content}
						</div>
						<!-- 文字2：评论信息 -->
						<div id="usertext<%=t2%>" style="height:100px;">
							<c:choose>
								<c:when test="${not empty p.clist}">
									<!-- 遍历评论内容 -->
									<c:forEach items="${p.clist }" var="m" end="1">
										<div style="height:50px;">
											<div style="width:320px;float:left;font-size:13px;font-family:微软雅黑;">
												<div style="width:290px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;float:left;">
												[<a target="_blank" style="cursor: pointer;"
												class="username1"
												href="getFriendOwnMessageAction?uname=${m.userName }">${m.userName
												} </a>]&nbsp;
												${m.commentContent}</div>
												<c:if test="${not empty m.commPic}"><a href="${m.commPic}" rel="lightbox"><img title="点击查看原图,右键下载图片" style="width:22px;height:22px;" src="${m.commPic}"/></a></c:if>
												<c:if test="${not empty m.filePath}"><img title="下载设计文件" src="images/xiazai.png" style="width:22px;height:22px;cursor:pointer;" onclick="window.location.href='downloadFile1?path=${m.filePath}&&filename=${m.fileName}'"/></c:if>
											</div>
											<div style="float:right;cursor:pointer;font-size:12px;color:blue;"
												onclick="chatSomeBody('${m.userName}')">私聊</div>
											<div style="float:right;cursor:pointer;font-size:12px;color:blue;"
												onclick="reportSomebody(${m.commentId})">举报|</div>
										</div>
									</c:forEach>
								</c:when>
								<c:otherwise>
									<font style="float:left">该定制还没有评论</font>
								</c:otherwise>
							</c:choose>
						</div>
						<!-- 文字3：显示更多 -->
						<c:choose>
							<c:when test="${p.listsize!=0}">
								<div id="moreComm<%=t2%>" style="height:40px;">
									显示更多评论(<a style="cursor: pointer;" href="javascript:;"
										onclick="showParticipateDetail('${p.id}','${p.type}');">${p.listsize}</a>)
								</div>
							</c:when>
							<c:otherwise>
								<div id="moreComm<%=t2%>" style="height:40px;">
									<a style="float:left" href="javascript:;"
										onclick="showParticipateDetail('${p.id}','${p.type}');">查看定制详细</a>
								</div>
							</c:otherwise>
						</c:choose>
						<form target="upload_target" method="post" name="plform" id="plform<%=t2%>" enctype="multipart/form-data" action="insertIntoComment.action">
							<input type="hidden" value="${p.id}" name="id" />
							<input type="hidden" value="${p.type}" name="type" />
							<!-- 文字4：评论输入框 -->
							<div style="height:30px;">
								<input value="" type="text" id="commenttext<%=t2%>" name="comment" style="width:300px;"/>
							</div>
							<!-- 文字5：上传和评论按钮 -->
							<div style="height:30px;">
								<input value="上传图片或文件" class="btnUploadFile" type="button"
									onclick="showUpload(this);$(this).remove();";>
								<input value="发表评论"
									style="color:rgb(122,3,3);margin-left:50px;" type="button"
									onclick="sendComment('${p.id}','${p.type}',<%=t2++%>)">
							</div>
							<iframe name="upload_target" style="display:none" id="upload_target"></iframe>
						</form>
					</div>
				</div>
			</c:forEach>
		</c:when>
		<c:otherwise>
		亲，暂时还没有分享哦！
	</c:otherwise>
	</c:choose>
</div>